// 导入 express
const express = require('express')
// 创建路由对象
const router = express.Router()
router.get('/students', (req, res) => {
  res.send({
    code: 200,
    data: [
      { id: 1, name: '张三' },
      { id: 2, name: '李四' }
    ],
    message: '查询成功'
  })
})
router.get('/demo/cars', (req, res) => {
  res.send({
    code: 200,
    data: [
      { id: 1, name: '奔驰' },
      { id: 2, name: '宝马' }
    ],
    message: '查询成功'
  })
})



// 向外共享路由对象
module.exports = router